package edu.ccut.saturn.studio.logic.model.saturn;

import java.util.List;

public class SaturnContent implements Comparable<SaturnContent> {

	private String id = "-1";

	private String type = "";

	private String contentValueKey = "";

	public SaturnContent() {
		super();
	}

	public SaturnContent(SaturnContent con) {
		super();
		this.id = con.getId();
		this.type = con.getType();
		this.contentValueKey = con.getContentValueKey();
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getContentValueKey() {
		return contentValueKey;
	}

	public void setContentValueKey(String contentValueKey) {
		this.contentValueKey = contentValueKey;
	}

	public boolean equals(Object object) {
		if (object instanceof SaturnContent) {

			SaturnContent saturnContent = (SaturnContent) object;

			return this.type.equals(saturnContent.getType())
					&& this.contentValueKey.equals(saturnContent
							.getContentValueKey());
		}
		
		return false;
	}

	public int compareTo(SaturnContent content) {
		if (this.id != null) {
			int idInt = Integer.parseInt(id);
			int contextIdInt = Integer.parseInt(content.getId());
			if (idInt > contextIdInt) {
				return 1;
			} else if (idInt == contextIdInt) {
				return 0;
			}
		}

		return -1;

	}

	public String toString() {
		return "";// this.classType + "#" + this.name;
	}

	public List<?> getChild() {
		return null;
	}

	public String getName() {
		return "transform" + getId();
	}

	public void setChild(List<?> list) {

	}
}
